
.home-container {
  min-height: 100vh;
  background: linear-gradient(180deg, #e3f2fd 0%, #f0f7ff 40%, #ffffff 100%);
  background-attachment: fixed;
}

.header {
  background: linear-gradient(170deg, #eef5fa 0%, #ecf2f9 70%, #ffffff 100%);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(58, 123, 213, 0.08);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.main-banner {
  flex: 1;
  background: #ccd8e056;
  border-radius: 8px;
  padding: 20px;
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(5px);
}

.banner-tabs {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-bottom: 15px;
}

.banner-tab {
  padding: 8px 15px;
  cursor: pointer;
  font-weight: 500;
  color: #555;
  transition: color 0.2s;
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.banner-tab.active {
  color: #3a7bd5;
  border-bottom: 2px solid #3a7bd5;
}

.banner-image {
  text-align: center;
}

.banner-image img {
  max-width: 100%;
  height: auto;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

.carousel-container {
  position: relative;
  width: 100%;
  height: 350px;
  overflow: hidden;
  border-radius: 8px;
  cursor: pointer;
}

.carousel-slides {
  display: flex;
  transition: transform 0.5s ease-in-out;
  height: 100%;
}

.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.5);
  border: none;
  font-size: 24px;
  padding: 10px 15px;
  cursor: pointer;
  z-index: 10;
  border-radius: 50%;
  transition: background 0.2s;
}

.carousel-arrow.left {
  left: 10px;
}

.carousel-arrow.right {
  right: 10px;
}

.carousel-indicators {
  position: absolute;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 10;
}

.dropdown-menu {
  position: absolute;
  top: 60px;
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  min-width: 145px;
  z-index: 1000;
  padding: 10px 0;
  font-size: 14px;
}

.dropdown-menu.show {
  display: block;
}

.dropdown-item {
  padding: 10px 20px;
  cursor: pointer;
  transition: background-color 0.2s;
  color: #333;
}

.dropdown-item:hover {
  background-color: #f5f5f5;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 90%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 15px 0;
}

.logo img {
  width: 60px;
  height: auto;
  border-radius: 8px;
}

.main-content {
  width: 90%;
  display: flex;
  gap: 30px;
  margin: 20px auto;
}

.rankings {
  width: 250px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* 右侧榜单入口区域 */
.rankings-entry {
  width: 250px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
}

.search-bar {
  display: flex;
  align-items: center;
  background: #f0f0f0;
  border-radius: 20px;
  padding: 8px 15px;
  flex: 1;
  max-width: 880px;
  margin-left: 65px;
  position: relative;
}

.search-bar input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 14px;
  padding: 0 8px;
}

.search-bar button {
  background: none;
  border: none;
  cursor: pointer;
  color: #007bff;
  font-size: 14px;
  font-weight: bold;
}

.user-avatar {
  width: 40px;
  height: 40px;
  background: #ddd;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #999;
  font-size: 20px;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.sidebar-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  color: #000000d6;
  transition: background 0.2s;
}

.product-grid {
  width: 90%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin: 30px auto;
}

.product-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
  transition: transform 0.2s;
}

.product-card-link:hover {
  transform: translateY(-5px);
}

.product-card {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.product-image {
  height: 200px;
  background: #f0f0f0;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.product-image img {
  width: 100%;
  height: 100%;
}

.product-info {
  padding: 15px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-title {
  font-weight: 600;
  margin: 0 0 8px 0;
  color: #333;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-subtitle {
  font-size: 14px;
  color: #999;
  margin: 0 0 12px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-description {
  font-size: 14px;
  color: #666;
  line-height: 1.4;
  margin: 0 0 12px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-review {
  font-size: 14px;
  color: #555;
  line-height: 1.5;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-review strong {
  display: block;
  margin-bottom: 8px;
  color: #333;
}

.slide {
  position: relative;
  min-width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  cursor: pointer;
  border-radius: 16px;
}

.slide:focus-visible {
  outline: 2px solid #3a7bd5;
  outline-offset: 2px;
}

.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.slide:hover img {
  transform: scale(1.03);
}

.slide-info {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.55);
  color: #ffffff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  backdrop-filter: blur(2px);
  min-height: 64px;
}

.slide-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.slide-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.slide-subtitle {
  color: rgba(255, 255, 255, 0.9);
  font-size: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.slide-price {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
}

.indicator {
  width: 10px;
  height: 10px;
  background: #ccc;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s;
}

.indicator.active {
  background: #3a7bd5;
}

.username:hover {
  background-color: #f0f0f08a;
}

.username {
  cursor: pointer;
  font-size: 16px;
  color: #333;
  font-weight: 500;
  font-weight: bolder;
  padding: 20px;
}

.user-info {
  display: flex;
  align-items: center;
}

.search-history-dropdown {
  position: absolute;
  top: 100%;
  left: 18px;
  right: 18px;
  background: #f0f0f0;
  border: 1px solid #e0e0e0;
  border-top: none;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  z-index: 999;
  max-height: 200px;
  overflow-y: auto;
}

.search-history-item {
  padding: 10px 15px;
  cursor: pointer;
  color: #333;
  font-size: 14px;
  border-bottom: 1px solid #f5f5f5;
  transition: background 0.2s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-history-item:hover {
  background: #f0f7ff;
}

.search-history-item:last-child {
  border-bottom: none;
}

/* 子分类悬浮层 */
.sub-category {
  position: absolute;
  top: 0;
  left: 100%;
  background: white;
  border: 1px solid #eee;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  padding: 8px 0;
  min-width: 120px;
  z-index: 100;
}

.sub-item {
  padding: 8px 16px;
  cursor: pointer;
  color: #333;
  font-size: 14px;
  display: block;
  width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sub-item:hover {
  background: #f5f5f5;
}

/* 确保 sidebar 相对定位 */
.sidebar {
  width: 250px;
  background: white;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #eaf1f9 40%, #e5f2fb 100%);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  padding: 15px;
  position: relative;
  /* ← 必须！让子菜单相对 sidebar 定位 */
}

.sidebar-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  color: #000000d6;
  position: relative;
  /* ← 子菜单相对于此项定位 */
}

.sidebar-item:last-child {
  border-bottom: none;
}

.sidebar-item::after {
  content: ">";
  color: #999;
}

.sidebar-item:last-child::after {
  content: ">";
  color: #999;
}

/* ========== 商品价格 ========== */
.product-price {
  color: #ff4d4f;
  font-size: 20px;
  font-weight: bold;
  margin-top: 8px;
}

/* ========== 加载和错误状态 ========== */
.loading-container,
.error-container {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 20px;
  color: #666;
}

.loading-container p {
  font-size: 16px;
  color: #999;
}

.error-container p {
  font-size: 16px;
  color: #ff4d4f;
  margin-bottom: 16px;
}

.error-container button {
  padding: 8px 16px;
  background-color: #1890ff;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}

.error-container button:hover {
  background-color: #40a9ff;
}
